package subumbo.leg.model.vo
{
	/**
	 * Value Object for the ResizeSignal
	 * It constrains to 800px width and 550px height  
	 * @author pwolleb
	 * 
	 */	
	public class ResizeVO
	{
		private var _width:Number;
		private var _height:Number;
		private var _minWidth:Number;
		private var _minHeight:Number;
		private var _centerX:Number;
		private var _centerY:Number;
		private var _widescreen:Boolean;
		
		public function ResizeVO(w:Number = 0, h:Number = 0, minWidth:Number = 800, minHeight:Number = 550) {
			_minWidth = minWidth;
			_minHeight = minHeight;
			width = w;
			height = h;
			_widescreen = (w > h) ? true : false;
		}
		
		
		/**
		 * Validates argument against minimum width defined in the constructor.
		 * @param val
		 */		
		public function set width(val:Number):void {
			val = Math.max(val, _minWidth);
			_width = val;
			_centerX = _width * .5;
		}
		
		
		/**
		 * Validates the argument against minimum height defined in the constructor.
		 * @param val
		 */		
		public function set height(val:Number):void {
			val = Math.max(val, _minHeight);
			_height = val;
			_centerY = _height * .5;	
		}
		
		/** 
		 * @return 
		 * 
		 */		
		public function get width():Number {
			return _width;
		}
		
		public function get height():Number {
			return _height;
		}
		
		/**
		 * Returns width / 2 
		 * @return 
		 * 
		 */		
		public function get centerX():Number {
			return _centerX;
		}
		
		/**
		 * Returns height / 2 
		 * @return 
		 * 
		 */		
		public function get centerY():Number {
			return _centerY;
		}
		
		public function get widescreen():Boolean {
			return _widescreen;
		}
		
		public function get minWidth():Number {
			return _minWidth;
		}
		
		public function get minHeight():Number {
			return _minHeight;
		}
	}
}